{extend name="index_layout"/}
{block name="main"}
<style>
.alert{margin-bottom: 12px;}
.layui-card-body{min-height: 60px;}
.layui-card-body i{font-size: 80px;line-height: 80px;position: absolute;right: 15px;top: 10px}
.layui-card-body h2{font-size: 32px;color: #666;font-weight: normal;line-height:60px;height:60px;}
.layui-card-body span{color: #7f8c8d;}
</style>
{notempty name="default_pass"}
<div class="alert alert-danger-light">
    安全提示：超级管理员默认密码未修改，建议马上修改。
</div>
{/notempty}
{if env('APP_DEBUG')}
<div class="alert alert-danger-light">
    安全提示：当前网站【调试模式】开启中，强烈建议在正式部署后关闭调试模式
</div>
{/if}
{if preg_match('/\/admin\/|\/admin\.php/i', url())}
<div class="alert alert-danger-light">
    安全提示：为了你的后台安全，请勿将后台管理入口设置为admin或admin.php
</div>
{/if}
<div class="alert alert-success-light">
    <div id="nowTime"></div>
</div>
<div class="layui-row layui-col-space10 panel_box mb-2">
    <div class="panel text-center layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">
        <a href="https://www.kancloud.cn/ken678/yzncms2_0" target="_blank">
            <div class="d-flex align-items-center">
                <div class="panel_icon yzn-bg-blue">
                    <i class="layui-icon layui-icon-read layui-anim"></i>
                </div>
                <div class="panel_word">
                    <span>文档</span>
                    <cite>使用手册</cite>
                </div>
            </div>
        </a>
    </div>
    <div class="panel text-center layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">
        <a href="https://gitee.com/ken678/YZNCMS" target="_blank">
            <div class="d-flex align-items-center">
                <div class="panel_icon yzn-bg-orange">
                    <i class="layui-icon layui-icon-fonts-code layui-anim"></i>
                </div>
                <div class="panel_word">
                    <span>代码</span>
                    <cite>下载链接</cite>
                </div>
            </div>
        </a>
    </div>
    <div class="panel text-center layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">
        <a href="http://blog.yzncms.com" target="_blank">
            <div class="d-flex align-items-center">
                <div class="panel_icon yzn-bg-green">
                    <i class="layui-icon layui-icon-survey layui-anim"></i>
                </div>
                <div class="panel_word">
                    <span>博客</span>
                    <cite>技术分享</cite>
                </div>
            </div>
        </a>
    </div>
    <div class="panel text-center layui-col-xs12 layui-col-sm6 layui-col-md4 layui-col-lg3">
        <a href="javascript:;">
            <div class="d-flex align-items-center">
                <div class="panel_icon yzn-bg-purple">
                    <i class="layui-icon layui-icon-log layui-anim"></i>
                </div>
                <div class="panel_word">
                    <span class="loginTime layui-font-blue layui-font-16">
                        <?php if($admin['last_login_time'] > 0) { echo $admin['last_login_time'];} else { echo '--';}?></span>
                    <cite>上次登录时间</cite>
                </div>
            </div>
        </a>
    </div>
</div>

<div class="layui-row layui-col-space10 mb-2">
    <div class="layui-col-md6 layui-col-lg3 layui-col-sm6">
        <div class="layui-card">
            <div class="layui-card-header d-flex justify-content-between align-items-center">
               插件数量<span class="layui-badge layui-bg-cyan">实时</span>
            </div>
            <div class="layui-card-body">
                <i class="iconfont icon-instance-line" style="color: rgba(255, 200, 200, 0.4);"></i>
                <div class="layui-row">
                    <div class="layui-col-sm6 layui-col-xs6">
                        <h2>{$totaladdon}</h2>
                        <span>总插件数</span>
                    </div>
                    <div class="layui-col-sm6 layui-col-xs6">
                        <h2>{$totalworkingaddon}</h2>
                        <span>运行中</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-col-md6 layui-col-lg3 layui-col-sm6">
        <div class="layui-card">
            <div class="layui-card-header d-flex justify-content-between align-items-center">
                数据库统计<span class="layui-badge layui-bg-cyan">实时</span>
            </div>
            <div class="layui-card-body">
                <i class="iconfont icon-database-2-line" style="color:rgba(200, 227, 255, 0.4);"></i>
                <div class="layui-row">
                    <div class="layui-col-sm6 layui-col-xs6">
                        <h2>{$dbtablenums}</h2>
                        <span>数据表数量</span>
                    </div>
                    <div class="layui-col-sm6 layui-col-xs6">
                        <h2>{$dbsize|format_bytes=###,'',0}</h2>
                        <span>占用空间</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-col-md6 layui-col-lg3 layui-col-sm6">
        <div class="layui-card">
            <div class="layui-card-header d-flex justify-content-between align-items-center">
                附件统计<span class="layui-badge layui-bg-cyan">实时</span>
            </div>
            <div class="layui-card-body">
                <i class="iconfont icon-file-line" style="color:rgba(255, 233, 200, 0.4);"></i>
                <div class="layui-row">
                    <div class="layui-col-sm6 layui-col-xs6">
                        <h2>{$attachmentnums}</h2>
                        <span>附件数量</span>
                    </div>
                    <div class="layui-col-sm6 layui-col-xs6">
                        <h2>{$attachmentsize|format_bytes=###,'',0}</h2>
                        <span>附件大小</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-col-md6 layui-col-lg3 layui-col-sm6">
        <div class="layui-card">
            <div class="layui-card-header d-flex justify-content-between align-items-center">
                图片统计<span class="layui-badge layui-bg-cyan">实时</span>
            </div>
            <div class="layui-card-body">
                <i class="iconfont icon-image-line" style="color:rgba(200, 207, 255, 0.4);"></i>
                <div class="layui-row">
                    <div class="layui-col-sm6 layui-col-xs6">
                        <h2>{$picturenums}</h2>
                        <span>图片数量</span>
                    </div>
                    <div class="layui-col-sm6 layui-col-xs6">
                        <h2>{$picturesize|format_bytes=###,'',0}</h2>
                        <span>图片大小</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="layui-row layui-col-space10">
    <div class="layui-col-md7">
        <div id="echart" class="btn-refresh" style="height:455px;width:100%;"></div>
    </div>
    <div class="layui-col-md5">
        <div class="layui-card">
            <div class="layui-card-header" style="border-bottom: 1px solid #eee;">版本信息</div>
            <div class="layui-card-body">
                <table class="layui-table" lay-even>
                    <colgroup>
                        <col width="50%">
                        <col width="50%">
                    </colgroup>
                    <tbody>
                        <tr>
                            <td>当前版本</td>
                            <td class="version">yzncms v{$Think.config.version.yzncms_version}</td>
                        </tr>
                        <tr>
                            <td>ThinkPHP版本</td>
                            <td class="version">{:app()->version()}</td>
                        </tr>
                        <tr>
                            <td>PHP 版本</td>
                            <td>{$sys_info.phpv}</td>
                        </tr>
                        <tr>
                            <td>数据库版本</td>
                            <td>{$sys_info.mysql_version}</td>
                        </tr>
                        <tr>
                            <td>服务器域名/IP</td>
                            <td>{$sys_info.domain} [ {$sys_info.ip} ]</td>
                        </tr>
                        <tr>
                            <td>服务器环境</td>
                            <td class="server">{$sys_info.web_server}</td>
                        </tr>
                        <tr>
                            <td>剩余空间</td>
                            <td>{$sys_info.remaining_space}</td>
                        </tr>
                        <tr>
                            <td>最大上传限制</td>
                            <td>{$sys_info.fileupload}</td>
                        </tr>
                        <tr>
                            <td>最大占用内存</td>
                            <td>{$sys_info.memory_limit}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{/block}